<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<%@ include file="/common/meta.jsp" %>
<title>主页</title>		
		<%@ include file="/common/extjs.jsp"%>
		<link href="${ctx}/styles/master/layout.css" rel="stylesheet" type="text/css"/>
		<link href="${ctx}/styles/master/screen/basemod_msg.css" rel="stylesheet" type="text/css"/>
		<%@ include file="/common/jquery.jsp" %>
<!--[if lte IE 7]>
<link href="${ctx}/styles/master/patches/patch_layout.css" rel="stylesheet" type="text/css" />
<![endif]-->

<script type="text/javascript">
$(document).ready(function() {
$("#receiveUser").click(function(){
	UserSelector.getView(function(a,c) {
   			$("#receiveUser").val(c);
   			$("#receiveUserId").val(a);
		 }).show();
});

//验证
$("#mainForm").validate({
	 rules:{
		 usernames:{
			 required:true,
		 },
		 subject:{
			 required:true,
		 },
		 content:{
			 required:true,
		 }
	 },
	 messages:{
		 usernames:{
			 required:"必须填写收件人！"
		 },
		 subject:{
			 required:"必须填写标题！"
		 },
		 content:{
			 required:"请填写内容！"
	 }
	 }
});
})
</script>
<script type="text/javascript">
	$(document).ready(function() {
		var type = '${fontype}';
		var mm = '${mm}';
		if(type != null){
			if(type=="1") 
				$("#fon-2").addClass("selectTag");
			if(type=="2") 
				$("#fon-1").addClass("selectTag");
		}
		if(mm != null){
			$("#acc${mm}").addClass("active");
		}
		$.post("${ctx}/app/messageinfo!getNoReadCount.action",{
			fontype:"2"},function(data){
				$("#notice").html(data);
			});
		$.post("${ctx}/app/messageinfo!getNoReadCount.action",{
			fontype:"1"},function(data){
				$("#system").html(data);
			});
	});
</script>
<style type="text/css">
  .page_margins { min-width:70px; max-width:80em; background:#fff; }
.active{
 border: 0px #a66 solid;
	   background: #f4f4f4;
	   }
</style>
</head>
<body >
<div class="page_margins">
  <div>
    <!-- begin: main navigation #nav -->
    <div id="nav" role="navigation" >
      <div id="tags" >
        <ul>
           <li id="fon-1"><a href="${ctx}/app/messageinfo.action?fontype=2" >通知(<span id="notice">0</span>)</a></li>
           <li id="fon-2"><a href="${ctx }/app/messageinfo.action?fontype=1" >系统消息(<span id="system">0</span>)</a></li>
        </ul>
        <input type="hidden" name="fontype" value="${fontype }"/>
      </div>
    </div>
    <!-- end: main navigation -->
    <!-- begin: main content area #main -->
    <div id="main" >
      <!-- begin: #col1 - first float column -->
      <div id="col1" role="complementary">
        <div id="col1_content" class="clearfix">
        <ul id="" class="msgul">
        <li id="acc6"><a href="${ctx}/app/messageinfo!input.action?mm=6&fontype=${fontype}">发送消息</a></li>
        <li id="acc4"><a href="${ctx}/app/messageinfo.action?sr=s&mm=4&fontype=${fontype}">发件箱</a></li>
        <li id="acc5"><a href="${ctx}/app/messageinfo.action?sr=r&mm=5&fontype=${fontype}">收件箱</a>
		<ul>
		<li id="acc1"><a href="${ctx}/app/messageinfo.action?mm=1&fontype=${fontype}&sr=${sr}">今天</a></li>
		<li id="acc2"><a href="${ctx}/app/messageinfo.action?mm=2&fontype=${fontype}&sr=${sr}">昨天</a></li>
		<li id="acc3"><a href="${ctx}/app/messageinfo.action?mm=3&fontype=${fontype}&sr=${sr}">更早</a></li>
		</ul>
		</li>
	</ul>
</div>
      </div>
      <!-- end: #col1 -->
      <!-- begin: #col3 static column -->
      <div id="col3" role="main" >
        <div>
        <form id="mainForm" action="${ctx}/app/messageinfo!save.action" method="post" class="yform" enctype="multipart/form-data">
        <input name="type" value="2" type="hidden"/>
        <input name="fontype" value="${fontype }" type="hidden"/>
        <input name="sr" value="s" type="hidden"/>
         <input name="mm" value="4" type="hidden"/>
<table style="width: 500px;" >
<tr><td align="left">收件人</td><td  align="left"><input type="text" id="receiveUser" name="usernames"  value="${receiveUser }" class="choose" readonly="readonly"/>
<input type="hidden" id="receiveUserId" name="Ids"  value="${receiveUser }"  readonly="readonly"/></td></tr>
<tr><td align="left">消息名称</td><td  align="left"><input type="text" name="subject" value="${subject }" id="subject"/></td></tr>
<tr>
<td align="left">消息级别</td>
<td align="left"><pt:code category="1009" default="${grade }" name="grade" width="80" ></pt:code> </td>
</tr>
<tr><td align="left">附件</td>
				<td  align="left"><input type="file"  name="attachmention.upfile" size="30"></input>
				</td></tr>
				<c:if test="${not empty attachment.id}">
				<tr id="attachment">
				<td align="left">已有附件</td>
				<td  align="left">
				<a title="下载"
					href="${ctx}/servlet/annex?id=${attachment.id}">${attachment.upfileFileName}</a>
				<a href="javascript:dea('${attachment.id}')" class="delete">删除</a>
				</td>
			</tr>
			</c:if>
		<tr><td align="left">消息内容</td><td  align="left"><textarea name="content" id="content" style="width: 380px; height: 93px"></textarea></td></tr>
		<tr><td colspan="2">
		<div class="type-button">
		<input  type="submit" class="submit"  value="发送" />
        <input  type="button" value="返回" class="reset"  class="reset" onclick="history.back()" />
</div>
</td></tr>
</table>
</form>
        </div>
         <div id="ie_clearing">&nbsp;</div>
        <!-- End: IE Column Clearing -->
      </div>
      <!-- end: #col3 -->
    </div>
    <!-- end: #main -->
  </div>
  </div>
<!-- full skip link functionality in webkit browsers -->
<script src="${ctx}/scripts/plugin/focusfix.js" type="text/javascript"></script>
</body>
</html>

